package com.dlc.shop.systemtest.api.amount;

import com.dlc.shop.common.util.PageParam;
import com.dlc.shop.distribution.common.dto.DistributionMsgDto;
import com.dlc.shop.distribution.common.model.DistributionMsg;
import com.dlc.shop.systemtest.constants.Constant;
import com.dlc.shop.systemtest.util.HttpUtil;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 分销公告接口
 * @author: zsm
 * @date: 2023/2/28 0:13
 */
public class DistributionMsgApi {

    /**
     * 获取公告详情
     * @param msgId 公告id
     * @return
     */
    public static DistributionMsgDto info(@RequestParam("msgId") Long msgId){
        String url = Constant.API_URL + "/p/distribution/msg/info" + "?msgId=" + msgId;
        return HttpUtil.get(url,DistributionMsgDto.class);
    }

    /**
     * 公告列表
     * @param page
     * @param isTop 是否置顶
     * @return
     */
    public static void page(PageParam<DistributionMsg> page,
                                                 @RequestParam(value = "isTop", required = false) Integer isTop) {
        String url = Constant.API_URL + "/p/distribution/msg/page?" + "isTop=" + isTop;
         HttpUtil.get(url);
    }
}
